package com.cennavi.buss.service.imp;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cennavi.buss.service.SourceService;
import com.cennavi.minemap.bean.MessageBean;

@FeignClient(value = "solu-service", fallback = SourceService.class)
public interface ISourceService {
	@RequestMapping(method = RequestMethod.POST, consumes = "application/x-www-form-urldecoded", value = "/service/source/update")
	public MessageBean update(@RequestBody String json);
	
	@RequestMapping(method = RequestMethod.GET, value = "/service/source/{id}")
	public MessageBean queryById(@PathVariable(value = "id") int id);
	
	@RequestMapping(method = RequestMethod.GET, value = "/service/source/statistic/{id}")
	public MessageBean queryStatisticById(@PathVariable(value = "id") int id);
	
	@RequestMapping(method = RequestMethod.GET, value = "/service/source/list")
	public MessageBean queryByUserGroupId(@RequestParam("userId") int userId, @RequestParam("groupId") int groupId);
	
	@RequestMapping(method = RequestMethod.GET, value = "/service/source/tileJson/{id}")
	public String queryStyle(@PathVariable(value = "id") int id);
	
	@RequestMapping(method = RequestMethod.GET, value = "/service/source/self/list/{userId}")
	public MessageBean querySelfById(@PathVariable(value = "userId") int userId);
	
	@RequestMapping(method = RequestMethod.GET, value = "/service/source/layerDesc/{id}")
	public MessageBean querySourceLayerDescById(@PathVariable(value = "id") int id);
	
	@RequestMapping(method = RequestMethod.GET, value = "/service/source/buy")
	public MessageBean sourceBuy(@RequestBody String json);
	
	@RequestMapping(method = RequestMethod.GET, value = "/service/source/group/list")
	public MessageBean queryGroup();
	
	@RequestMapping(method = RequestMethod.GET, value = "/service/source/group/list/{userId}")
	public MessageBean queryGroupByUserId(@PathVariable(value = "userId") int userId);
	
	@RequestMapping(method = RequestMethod.GET, value = "/service/source/info/list/{userId}")
	public @ResponseBody MessageBean queryGroupSourceLayerBy(@PathVariable(value = "userId") int userId);
	
}
